﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestMapDrawArea.aspx.cs" Inherits="TestWebMap.TestMapDrawArea" %>

<%@ Import Namespace="System.Web.Map.Model" %>
<%@ Import Namespace="Newtonsoft.Json" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
     <style>
        html, body, iframe {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            border: none;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <%
        var data = new MapDrawAreaRequestModel()
        {
            ReturnUrl = "save",
            //SaveAjaxUrl = "/savemapajax.ashx",
            // SaveAjaxUrl = "/savemapajax.ashx?jsoncallback=?"/*跨域请求写法*/,
            mapBelongs = new List<MapBelong>()
            {
                new MapBelong()
                {
                    mapId = "001",
                    text = "大厨房"
                },
                new MapBelong()
                {
                    mapId = "002",
                    text = "坂田002",
                    label = "坂田"
                }
            },
        };
        reqParamData.Value = JsonConvert.SerializeObject(data);
    %>
    <iframe frameborder="0" name="frame" id="frame"></iframe>
    <form id="form1" runat="server" action="http://mapdev.lizhanglong.com/Map.aspx" target="frame">
        <asp:HiddenField runat="server" ID="reqParamData" />
        <input type="hidden" value="MapDrawArea" name="method" />
    </form>
    <script>
        if (!/^[\d\.\:]+$/.test(location.host)) {
            document.domain = location.host.match(/(\w+\.\w+)(:|$)/)[1];
        }
        function save(data) {
            alert(JSON.stringify(arguments));
        }
        document.forms[0].submit();
    </script>
</body>
</html>
